import request from '@/utils/request'

// 创建团购订单
export function createGroupOrder(data) {
  return request({
    url: '/qd/group-order/create',
    method: 'post',
    data: data
  })
}

// 更新团购订单
export function updateGroupOrder(data) {
  return request({
    url: '/qd/group-order/update',
    method: 'put',
    data: data
  })
}

// 删除团购订单
export function deleteGroupOrder(id) {
  return request({
    url: '/qd/group-order/delete?id=' + id,
    method: 'delete'
  })
}

// 获得团购订单
export function getGroupOrder(id) {
  return request({
    url: '/qd/group-order/get?id=' + id,
    method: 'get'
  })
}

// 获得团购订单分页
export function getGroupOrderPage(query) {
  return request({
    url: '/qd/group-order/page',
    method: 'get',
    params: query
  })
}

// 导出团购订单 Excel
export function exportGroupOrderExcel(query) {
  return request({
    url: '/qd/group-order/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
